export const list2String = (list) => {
  let rs = ''
  if (list) {
    list.forEach((item) => {
      rs += item.name + '|'
    })
  }
  if (rs) {
    rs = rs.substring(0, rs.length - 1)
  }
  return rs
}

export const idList2ItemList = (itemList, idList) => {
  let list = []
  if (idList) {
    idList.forEach((id) => {
      let value = itemList.find((item) => item.id == id)
      if (value) {
        list.push({id: id, name: value.name})
      }
    })
  }
  return list
}
